import request from "@/router/axios";
export const loginByUsername = (userName, password) =>
  request({
    url: "/admin/user/login",
    method: "post",
    data: {
      userName,
      password,
    },
  });

export const getUserInfo = () =>
  request({
    url: "/user/getUserInfo",
    method: "get",
  });

export const RefeshToken = () =>
  request({
    url: "/user/refesh",
    method: "post",
  });

export const getMenu = () =>
  request({
    url: "/admin/user/findUserPermissions",
    method: "POST",
    data: {},
  });

export const getMenuAll = () =>
  request({
    url: "/user/getMenu",
    method: "get",
    data: {
      type: 0,
    },
  });

export const logout = () =>
  request({
    url: "/admin/user/logout",
    method: "post",
    data: {},
  });
